package com.zfast.config.mybatis;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ApiModel
public class BaseResult<T> implements Serializable {
    @ApiModelProperty(name = "code", notes = "状态码")
    @Builder.Default
    private int code = 0;

    @ApiModelProperty(name = "message", notes = "执行结果消息提示信息")
    private String msg;

    private T data;

    @ApiModelProperty(name = "ok", notes = "状态 true：操作成功  false：操作失败")
    @Builder.Default
    private boolean ok = true;

    //region 快速文字回复
    /*public void success(String message) {
        this.msg = message;
    }

    public void fail(String message) {
        this.ok = false;
        this.msg = message;
    }*/

    //endregion
}
